home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / Rinaldi / HC 1.2 & 2.0 / TextRes 1.4.cpt / TextRes 1.4 (US) / card_3055.txt < prev    next >
Text File  |  1992-05-05  |  4KB  |  143 lines

  1. -- card: 3055 from stack: in.4 (US)
  2. -- bmap block id: 3273
  3. -- flags: 0000
  4. -- background id: 2661
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 0007
  11. -- rect: left=69 top=68 right=252 bottom=434
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 5 (button)
  23. -- low flags: 00
  24. -- high flags: A003
  25. -- rect: left=174 top=281 right=311 bottom=343
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: TextRes
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   ask "Resource text :" with "This is a sample text"
  37.   if it is empty then exit mouseUp
  38.   put it into Text
  39.  
  40.   ask "Resource type :" with "TEXT"
  41.   if it is empty then exit mouseUp
  42.   put it into Type
  43.  
  44.   answer "Add resource in :" with "Cancel" or "Other file" or "This stack"
  45.   if it is "Cancel" then exit mouseUp
  46.  
  47.   if it is "Other file"
  48.   then
  49.   if last word of the version ‚â• 2.0
  50.   then answer file "Destination file :"
  51. else ask "Destination file :"
  52. if it is empty then exit mouseUp
  53.  
  54. TextRes Text,Type,it
  55. else TextRes Text,Type
  56.  
  57. if first word of the Result is "Error"
  58. then answer the result
  59. else answer "Created resource : " & the Result
  60. end mouseUp
  61.  
  62.  
  63. -- part contents for card part 1
  64. ----- text -----
  65.  
  66.  
  67.                                              TextRes 1.4
  68.  
  69.                                        by Fr√©d√©ric RINALDI
  70.  
  71.  
  72. DESCRIPTION
  73. ------------
  74.   TextRes allows to create any kind of text resource (STR, STR#, TEXT, etc) in a file.
  75.  
  76. SYNTAX
  77. -------
  78.                TextRes <text>,<res type>[,<res ID>][,<res name>]
  79.                              [,<fileName>][,<sep.char>][<replace>]
  80.  
  81. PARAMETERS
  82. ------------
  83.    <text> is the text that will be written as resource in the file.
  84.  
  85.    <res type> is a four chars string, case sensitive, giving the resource type.
  86.  
  87.    <res ID> is an integer. If not supplied, any free ID will be used.
  88.  
  89.    <res name> defines the name of the created resource.
  90.  
  91.    <fileName> is the pathname of the destination file. Default is current resource file.
  92.  
  93.    <sep.char> is useful only with STR# resource creation, and allows to define the entries separator. Default is return.
  94.  
  95.    <replace> is a boolean, making all previous resource(s) with same name or ID to be replaced by the new one. Default is TRUE.
  96.  
  97.    Using "!", "?" and "=" as first parameter will return an online help (resp. copyright,  syntax and output).
  98.  
  99. USING
  100. -----
  101.    If the supplied file name doesn't exist, it is created by the XCMD.
  102.    The XCMD returns <ID[,name]> of the new resource in the result.
  103.  
  104. ERRORS
  105. -------
  106. If an error occurs, TextRes can return :
  107.      "Error : Duplicate resource ID"         (only if Replace = FALSE)
  108.      "Error : Duplicate resource name"    (only if Replace = FALSE)
  109.      "Error : Missing or empty parameter(s)"
  110.      "Error : Bad resource type"
  111.      "Error : Out of memory"
  112.      "Error : Couldn't create resource"
  113.      "Error : Not a file"
  114.      "Error : Alias file not supported"
  115.      "Error : Volume not found"
  116.      "Error : Bad Name"
  117.      "Error : Folder not found"
  118.      "Error : File is busy"
  119.      "Error : I/O Error"
  120.      "Error : Folder is full"
  121.      "Error : Volume is locked"
  122.      "Error : AppleShare insufficient privileges"
  123.  
  124. HISTORY
  125. --------
  126. 1.4 :                                                                                          05/05/92
  127. ‚Ä¢ Added <replace> param
  128.  
  129. 1.3 :                                                                                          03/09/92
  130. ‚Ä¢ Write allowed in an already opened resource file
  131.  
  132. 1.2 :                                                                                          03/07/92
  133. ‚Ä¢ Fixed parameters parsing
  134.  
  135. 1.1 :                                                                                          02/23/92
  136. ‚Ä¢ First release
  137. --------------------------------------------------------------------
  138. This (these) external(s) is (are) FreeWare,allowing unlimited use in any non-commercial stack. You just need in this case to mention the author's name and copyright in your stack.
  139. Any commercial use must be licensed and aknowledged by the author.
  140.  
  141.                                           ¬© F. Rinaldi - 1992
  142.  
  143. AppleLink: RINALDI1        CalvaCom : FR10        Compuserve : 71170,2111